package com.wuxu.huanfu
import android.os.Bundle
import android.widget.ImageView
import android.widget.TextView
import androidx.appcompat.app.AppCompatActivity
import com.wuxu.lib_skin_core.constant.SKIN_APK_TYPE
import com.wuxu.lib_skin_core.res.ResourceSingleton
import com.wuxu.lib_skin_core.res.SkinManager


/**
 *@author wuxu
 *@date 2024/5/16 18:34
 *@description 换肤测试页面
 */
class HFActivity : AppCompatActivity() {
     private val SKIN_APK_PATH="/data/data/com.wuxu.huanfu/skin_app-debug.apk"

    private val ivTest: ImageView by lazy { findViewById(R.id.iv_test) }
    private val tvTest: TextView by lazy { findViewById(R.id.tv_test) }

    override fun onCreate(savedInstanceState: Bundle?) {
        //关键步骤，设置Factory，用于view的创建。
//        LayoutInflaterCompat.setFactory2(layoutInflater, WXFactory(this,resMgr))
        super.onCreate(savedInstanceState)
        setContentView(R.layout.activity_huanfu)

        tvTest.setOnClickListener {
            SkinManager.loadSkin(this,SKIN_APK_PATH, SKIN_APK_TYPE)

            ivTest.setImageDrawable( ResourceSingleton.getDrawable(this,R.drawable.img))
        }
    }
}